home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _GETCRSR.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  63 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3.  
  4. #ifndef        NDEBUG
  5. char *rcsid__getcrsr = "$Header: c:/curses/private/RCS/_getcrsr.c%v 2.0 1992/11/15 03:24:25 MH Rel $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_get_cursor_mode()        - Get the cursor start and stop scan lines.
  14.  
  15.   PDCurses Description:
  16.        Gets the cursor type to begin in scan line startrow and end in
  17.        scan line endrow.  Both values should be 0-31.
  18.  
  19.   PDCurses Return Value:
  20.        This function returns OK on success and ERR on error.
  21.  
  22.   PDCurses Errors:
  23.        No errors are defined for this function.
  24.  
  25.   Portability:
  26.        PDCurses        int PDC_get_cursor_mode( void );
  27.  
  28. **man-end**********************************************************************/
  29.  
  30. int    PDC_get_cursor_mode(void)
  31. {
  32. #ifdef FLEXOS
  33.        /*
  34.         * Under FLEXOS, this routine returns 1 if the cursor is on and 0 if
  35.         * the cursor is off...
  36.         */
  37.        s_getfield(T_VIRCON, VC_MODE, STDOUT, (far BYTE *) & vir,
  38.                sizeof(vir.vc_mode));
  39.  
  40.        if (vir.vc_mode & VCWM_CURSOR)
  41.                return (TRUE);
  42.        else
  43.                return (FALSE);
  44. #endif
  45. #ifdef DOS
  46.        short far*      CURSOR_MODE;
  47.        short           cmode;
  48.  
  49.        CURSOR_MODE = (short far *) 0x0460L;
  50.        cmode = *CURSOR_MODE;
  51.        return (cmode);
  52. #endif
  53. #ifdef OS2
  54.        VIOCURSORINFO cursorInfo;
  55.        short           cmode;
  56.  
  57.        VioGetCurType (&cursorInfo, 0);
  58. /* I am not sure about this JGB */
  59.        cmode = ((cursorInfo.yStart << 8) | (cursorInfo.cEnd));
  60.        return(cmode);
  61. #endif
  62. }
  63.